package com.blue.gateway.api;

import com.blue.gateway.annotation.Log;
import com.blue.gateway.common.request.*;
import com.blue.gateway.common.response.BillResponse;
import com.blue.gateway.common.response.PayNotifyResponse;
import com.blue.gateway.common.response.PayResponse;
import com.blue.gateway.common.response.RefundResponse;
import com.blue.gateway.paycore.ChannelServiceDispatcher;
import com.blue.gateway.dto.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author xiaoyiming
 * @date 2020/5/3 16:03
 * @depiction 对外暴露的支付接口
 */
@Slf4j
@Service
public class PaymentClient {

    @Log
    public Result<PayResponse> pay(PayRequest payRequest) {
        return ChannelServiceDispatcher.request(payRequest);
    }

    @Log
    public Result<PayResponse> payQuery(PayQueryRequest payRequest) {
        return ChannelServiceDispatcher.request(payRequest);
    }

    @Log
    public Result<PayNotifyResponse> notify(PayNotifyRequest payNotifyRequest) {
        return ChannelServiceDispatcher.request(payNotifyRequest);
    }

    @Log
    public Result<RefundResponse> refund(RefundRequest refundRequest) {
        return ChannelServiceDispatcher.request(refundRequest);
    }

    @Log
    public Result<RefundResponse> refundQuery(RefundRequest refundRequest) {
        return ChannelServiceDispatcher.request(refundRequest);
    }

    @Log
    public Result<BillResponse> billDownload(BillRequest billRequest) {
        return ChannelServiceDispatcher.request(billRequest);
    }
}
